<?php

namespace plugin\ycMassage\app\model;

use app\common\service\UploadService;

class MassageServiceImage extends Model
{
    protected $json = ['images'];
    protected $jsonAssoc = true;
    public function getImagesAttr($value)
    {
        return $value ? UploadService::url($value) : [];
    }
    public function setImagesAttr($value)
    {
        $data = [];
        foreach ($value as $key => $url) {
            $data[] = UploadService::path($url);
        }
        return $data;
    }
}
